import request from '@/utils/request'

// 查询财务主列表
export function listAccounthead(query) {
  return request({
    url: '/basicsystem/accounthead/list',
    method: 'get',
    params: query
  })
}

// 查询财务主详细
export function getAccounthead(id) {
  return request({
    url: '/basicsystem/accounthead/' + id,
    method: 'get'
  })
}

// 新增财务主
export function addAccounthead(data) {
  return request({
    url: '/basicsystem/accounthead',
    method: 'post',
    data: data
  })
}

// 修改财务主
export function updateAccounthead(data) {
  return request({
    url: '/basicsystem/accounthead',
    method: 'put',
    data: data
  })
}

// 删除财务主
export function delAccounthead(id) {
  return request({
    url: '/basicsystem/accounthead/' + id,
    method: 'delete'
  })
}
// 删除财务主
export function delAccountheadQc(id) {
  return request({
    url: '/basicsystem/accounthead/qc/' + id,
    method: 'delete'
  })
}

//根据编号查询账户单据信息
export function getAccountDetailByNumber(query) {
  return request({
    url: '/basicsystem/accounthead/getDetailByNumber',
    method: 'get',
    params: query
  })
}
// 修改单据状态
export function updateAccountheadStatus(ids,status) {
  return request({
    url: '/basicsystem/accounthead/' + status + '/' + ids,
    method: 'get'
  })
}
// 获取账单单据编号
export function getAccountNo(type) {
  return request({
    url: '/basicsystem/accounthead/getAccountNo/' + type,
    method: 'get'
  })
}

// 获取账单详情内容
export function getDetailList(query) {
  return request({
    url: '/basicsystem/accounthead/getDetailList' ,
    method: 'get',
    params: query
  })
}
